package biz

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/trace"
)

type GinBiz struct {
	log     *log.Helper
	baseBiz *BaseBiz
	// TODO 如果有操作 DB/redis 可以加上repo 并在data层定义自己的repo(封装data——>data中再初始化下DB与redis)
}

func NewGinBiz(logger log.Logger, baseBiz *BaseBiz) *GinBiz {
	return &GinBiz{
		log:     log.NewHelper(logger),
		baseBiz: baseBiz,
	}
}

func (g *GinBiz) GetStudentList(ctx context.Context, sid string) ([]string, error) {
	ctx, span := otel.Tracer("Biz").Start(ctx, "GetStudentListBiz", trace.WithSpanKind(trace.SpanKindInternal))
	defer span.End()

	// trace
	span.SetAttributes(attribute.String("sid", sid))

	panic("hahaah")

	return []string{sid}, nil
}
